<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
    </head>
    <body>
        <div class='triangle'></div>

        <script>
            var triangle = document.querySelector('.triangle');
            // var itemSpan = ''
            // var startStr = '*'
            // var maxLen = 3
            // for (let i = 0; i < maxLen; i++) {
            //   itemSpan = document.createElement('span')
            //   itemSpan.innerText = startStr
            //   triangle.appendChild(itemSpan)
            //   if (i < maxLen - 1) {
            //     triangle.appendChild(document.createElement('br'))
            //   }
            //   startStr += '*'
            // }
            triangle.innerHTML = `*<br>**<br>***<br>`
        </script>
    </body>
</html>